<%@page import="com.kensure.shike.sys.model.SKDict"%>
<%@page import="java.util.List"%>
<%@page import="com.kensure.shike.sys.service.SKDictService"%>
<%@page import="com.kensure.shike.constant.BusiConstant"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8"%>

<!DOCTYPE html>
<html>
<jsp:include page="base/header.jsp" flush="true"> 
 <jsp:param value="财务流水" name="pageTitle"/>
</jsp:include>

<!--必要样式-->
<link rel="stylesheet" href="<%=BusiConstant.context%>/common/css/style.css" type="text/css" />
<body>
<jsp:include page="base/nav.jsp" flush="true"></jsp:include>

	<div class="layui-field-box">
 
    	<form class="layui-form" id="chaxun">
	    	<div class="layui-form-item">
	    	
		   		<div class="layui-inline">
			    	<label class="layui-form-label">发生时间</label>
					<div class="layui-inline">
						 <input name="startCreatedTime" id="startCreatedTime" style="width:200px;" type="text" value="">至<input name="endCreatedTime" id="endCreatedTime" style="width:200px;" type="text" value="" >
					</div>
		    	</div>
		    	
		    	<div class="layui-inline">
			    	<label class="layui-form-label">账户类型</label>
					<div class="layui-inline">
						 <select id="busitypeid" name="busitypeid" style="width:auto;">
				            <option value="" selected="selected">全部</option>
				            <%List<SKDict> dictlist = SKDictService.getListCache(5);
				            	for(SKDict dict:dictlist){ %>
				                <option value="<%=dict.getCode()%>"><%=dict.getName() %></option>
				             <%} %>
				        </select>
					</div>
		    	</div>

				<div class="layui-inline">
			    	<label class="layui-form-label">用户编号</label>
					<div class="layui-inline">
						 <input name="userid" type="text" value="">
					</div>
		    	</div>
	        	<input onclick="huodonglist(1)" class='self-btn' type="button" value="搜索">
	        	
	        </div>
	    </form>
      
    </div>
  
   
    <div >
        <div>	
         	<table id="headtable">
         		<thead></thead>
             	<tbody></tbody>
            </table>
        </div>
        <div id="fanye"></div>
    </div>
</div>

</body>



<script>


//JavaScript代码区域，layui初始化
layui.use(['element', 'layer', 'form', 'laydate', 'upload'], function() {
	var $ = layui.jquery;
	var element = layui.element;
	var layer = layui.layer;
	var form = layui.form;
	var laydate = layui.laydate,
		upload = layui.upload;
	
});

	var table = createtable("headtable");
	
	var yuetdfun = function(row){
	    var yue = (row.yue+row.wxyue+row.dbyue)*row.inorout;
	    return yue;
	}
	
	
	var table = createtable("headtable");
	table.th =  [{w:100,na:"流水编号",colname:"id"}
	,{w:200,na:"发生时间",colname:"createdTimeStr"}
	,{w:100,na:"账务类型",colname:"busitypeidStr"}
	,{w:100,na:"金额",callfun:yuetdfun}
	,{w:100,na:"状态",colname:"statusStr"}
	,{w:100,na:"进出",colname:"inoroutStr"}
	,{w:80,na:"用户编号",colname:"userid"}
	,{w:80,na:"昵称",colname:"user.nickname"}
	,{w:200,na:"备注",colname:"remark"}];
	
	table.thinit();
	
	function sucdo(data){
		var rows = data.resultData.rows;
		fanye.init(data.resultData.total);	
		if(rows){	
			table.data = rows;
			table.tdinit();		
		}	
	}

	var fanye = new FanYe("fanye","huodonglist",0,20,1);
	
	
   function huodonglist(current){
	   if(!fanye.setpage(current)){
			return;
	 	}
	   var data = formtojson($('#chaxun'));
	   data.pageNo = fanye.current;
	   data.pageSize = fanye.limit;
	   var url = getbaseurl("/zhang/allzhanglist.do");
	   postdo(url, data, sucdo,null, null);
   }

   huodonglist(1);
   layui.use('laydate', function(){
	   var laydate = layui.laydate;  
	   //时间控件
	   laydate.render({
		 elem: '#startCreatedTime'
		,type: 'datetime'
	   });
	   laydate.render({
		 elem: '#endCreatedTime'
		,type: 'datetime'
	   });
	});
        
</script>


</html>